<html lang="en">
<head>
  <meta charset="utf-8">
  <title>autocomplete demo</title>
  <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css">
  <script src="http://code.jquery.com/jquery-1.9.0.js"></script>
  <script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
</head>
<body>
 

<input id="autocomplete" />
 
<script>
//var src = document.getElementById('one').value;// = "nisarg mehta abc";
//var src1 = src.split(" ");
var src;
var src1 = new Array();
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()	
	{
		if(xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			src = xmlhttp.responseText;
			src1 = src.split(",");
			document.getElementById('one').innerHTML = src;
			$( "#autocomplete" ).autocomplete({
				source: src1//[ "c++", "java", "php", "coldfusion", "javascript", "asp", "ruby" ]
			});
		}
	}
	xmlhttp.open("GET","list_of_all_guides.php",true);
	xmlhttp.send();
	
	/*$( "#autocomplete" ).autocomplete({
  source: src.split(" ");//[ "c++", "java", "php", "coldfusion", "javascript", "asp", "ruby" ]
});*/
</script>
<?php echo "<label id='one'>one</label>"; ?>
</body>
</html>